package cn.com.ege.mvc.service.impl.business;

import java.io.Serializable;

import cn.com.ege.mvc.exception.BusinessException;
import cn.com.ege.mvc.model.business.Purchase;
import cn.com.ege.mvc.service.BaseService;

public class PurchaseService extends BaseService<Purchase> implements Serializable{
	public void save(Purchase purchase) throws BusinessException{
		if (null != purchase && null != purchase.getPurchase_id()) {
			if(null != purchase.getId() && 0 != purchase.getId()){
				update(purchase);
			}else{
				add(purchase);
			}
		}else {
			throw new BusinessException("采购单ID不能为空!");
		}
	}
}
